from django import template
from detlefschneider.gallery.models import Category

register = template.Library()

@register.inclusion_tag('gallery/templates/category_nav.html', takes_context=True)
def category_nav(context, active):
    categories = Category.objects.filter(active=True)

    return {
        'active': active,
        'categories': categories,
    }